﻿@model IEnumerable<DslamPort.Models.DslamModel>        
<!--Body-->
<div align="center">
    <h1>
        QUẢN TRỊ GPON</h1>
</div>
<div class="container_12">
    <div class="grid_12">
        @if (TempData["msg"] != null)
        {                            
            <span class="notification n-success">@TempData["msg"]</span>
        }
        @if (TempData["error"] != null)
        {                            
            <span class="notification n-error">@TempData["error"]</span>
        }
        @using (Html.BeginForm("FindDslam", "GPON", FormMethod.Post, new { id = "FindDslam", name = "FindDslam" }))
        {
             <p style="text-align: left; width: 40%; padding-left: 5px">
                Đơn vị:&nbsp&nbsp&nbsp&nbsp&nbsp
                @if (ViewBag.donvi != null)
                {                               
                    @Html.DropDownList("quan_huyen_id", ViewBag.donvi as SelectList, "---Chọn đơn vị---")                               
                }
            </p>      
            <div class="bottom-spacing">
                Tìm kiếm:
                <select name="select_option" style="width: 22.3%; margin-left: 7px">
                    <option value="dslam.system_id"  @(ViewBag.find_selectbox == "dslam.system_id" ? "selected" : "") >
                        Mã thiết bị</option>                    
                </select>
                <input type="text" class="input-short" name="timkiem" value="@ViewBag.find_textbox" style="width:20%; margin-left:20px" />
                <input class="submit-green" type="submit" value="Tìm kiếm" style="width: 8.5%; padding-left: 3px" />
                
                <div class="float-right">
                    <a href="@Url.Action("AddDslam", "GPON")" class="button"><span>Thêm mới
                        <img src="@Url.Content("~/Content/Body/Images/plus-small.gif")"  width="12" height="9" alt="Thêm mới" /></span>
                    </a>
                    <a href="@Url.Action("GPON", "DONGBO")" class="button"><span>Thêm mới tự động 
                        <img src="@Url.Content("~/Content/Body/Images/plus-small.gif")"  width="12" height="9" alt="Thêm mới" /></span>
                    </a>
                </div>
            </div>   
        }
        @using (Html.BeginForm("CheckedAction", "GPON", FormMethod.Post, new { id = "CheckedAction", name = "CheckedAction" }))
        {           
            <div class="module">
                <h2>
                    <span>@*Sample table*@</span></h2>
                <div class="module-table-body">
                    <div class="scrolling">
                        <div class="data-table" style="width: 150%">
                            <table id="myTable" class="tablesorter">
                                <thead>
                                    <tr>
                                        <th style="width: 7%;">
                                        </th>
                                        @*<th style="width: 1%;">
                                        </th>*@
                                        <th style="width: 4%;">
                                            STT
                                        </th>
                                        <th>
                                            System ID
                                        </th>
                                        <th>
                                            Tên Dslam
                                        </th>
                                         <th>
                                            IP
                                        </th>
                                        <th>
                                            Loại Dslam
                                        </th>
                                        <th>
                                            Dslam Option
                                        </th>
                                        <th>
                                            Tên đơn vị
                                        </th>
                                        <th>
                                            Trạng thái
                                        </th>
                                        @*<th style="width:130px;">Họ tên</th>*@
                                    </tr>
                                </thead>
                                <tbody>
                                    @{int stt = 0;}
                                    @foreach (var item in Model)
                                    {
                                        stt++;
                                        <tr>
                                            <td>
                                                <a href="@Url.Action("DeleteDslam", "GPON", new { id = item.id })" onclick="return confirm('Bạn muốn xóa thông tin này?');" title="Xóa thông tin">
                                                    <img src="@Url.Content("~/Content/Body/Images/cross-on-white.gif")" width="16" height="16" alt="delete" /></a>&nbsp;&nbsp;&nbsp;
                                                <a href="@Url.Action("EditDslam", "GPON", new { id = item.id })" title="Sửa thông tin">
                                                    <img src="@Url.Content("~/Content/Body/Images/pencil.gif")"  width="16" height="16" alt="edit" /></a>&nbsp;&nbsp;&nbsp;
                                                    <a href="@Url.Action("GetDungluong", "GPON", new { id = item.id })" onclick="return confirm('Bạn muốn lấy dung lượng cổng DSLAM?');" title="Lấy dung lượng oổng DSLAM">
                                                    <img src="@Url.Content("~/Content/Body/Images/download.jpg")"  width="16" height="16" alt="edit" /></a>&nbsp;&nbsp;&nbsp;
                                            </td>
                                            @*<td class="align-center">
                                                <input type="checkbox" name="Items" id="Items[]" value="@item.Dslam_name"/>
                                            </td>*@
                                            <td class="align-center">@stt
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.system_id)
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.name)
                                            </td>
                                             <td>@Html.DisplayFor(modelItem => item.ip)
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.dslam_type_name)
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.dslam_option)
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.ten)
                                            </td>
                                            @if (item.status == "0")
                                            { 
                                                <td>
                                                    Khóa
                                                </td>
                                            }
                                            else
                                            {
                                                <td>
                                                    Bình thường
                                                </td>
                                            }
                                        </tr>
                                    }
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="pager" id="pager">
                        <div>
                            <img class="first" src="@Url.Content("~/Content/Body/Images/arrow-stop-180.gif")"  alt="first"/>
                            <img class="prev" src="@Url.Content("~/Content/Body/Images/arrow-180.gif")" alt="prev"/>
                            <input type="text" class="pagedisplay input-short align-center" />
                            <img class="next" src="@Url.Content("~/Content/Body/Images/arrow.gif")" alt="next"/>
                            <img class="last" src="@Url.Content("~/Content/Body/Images/arrow-stop.gif")" alt="last"/>
                            <select class="pagesize input-short align-center">
                                <option value="20" selected="selected">20</option>
                                <option value="30">30</option>
                                <option value="40">40</option>
                            </select>
                        </div>
                    </div>
                    <div style="clear: both">
                    </div>
                </div>
            </div> 
        }
    </div>
    <div style="clear: both;">
    </div>
</div>
